Skip to content

Conversation

Satyam
Copy link

@Satyam Satyam commented Oct 17, 2023

Provides an option to add formatters to value outputs.

It doesn't really make sense to pre-process the values with its formatted version just before the template. That would require to make a full copy of an entire table, with the memory and processing resources it takes, when it can really be processed on-the fly while it is being interpolated into the template.

It also allows for some fancy processing as shown in the last test in the test suite below where the render function itself is the formatter, allowing for the recursive processing of a tree-like data structure of an indeterminate depth.

Fixes jasonmoo#7
Any value tag can be followed by the name of one or several functions to
process the raw value into a form suitable for display.
Contains source, modified Readme and test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant